#include "hal.h"
#include "dbg_tool.h"

static hrt_abstime _test_ts0;
static hrt_abstime _elapsed_us;
static hrt_abstime _test_ts1;
static U32         _elapsed_ms;

/**
 *@brief main function
 */
int main(void)
{
    /* Initiate the HAL libraries */
    hal_init();

    while (1)
    {       
        _test_ts0 = hal_hrt_get_us();
        _test_ts1 = hal_hrt_get_ms();
        
        hal_delay_ms(100);//~58us Error
        
        _elapsed_us = hal_hrt_elapsed_us(_test_ts0);
        _elapsed_ms = hal_hrt_elapsed_ms(_test_ts1);
        trace_info("HRT %lld DT:%lldus, %dms", _test_ts0, _elapsed_us, _elapsed_ms);
    }
}
